//
//  StoryAllTableViewCell.m
//  GOGOTravel
//
//  Created by dllo on 16/1/28.
//  Copyright © 2016年 果果. All rights reserved.
//

#import "StoryAllTableViewCell.h"
#import "Spot.h"
@implementation StoryAllTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
    }
    return self;
}

- (void)setTripModel:(Trip *)tripModel{
    if (_tripModel != tripModel) {
        [_tripModel release];
        _tripModel = [tripModel retain];
        
        [self setValues];
    }
     
    
    _ImageView1.layer.cornerRadius = 30;
    _ImageView1.layer.masksToBounds = YES;
    _ImageView1.layer.borderColor = [UIColor whiteColor].CGColor;
    _ImageView1.layer.borderWidth = 2;
    
    
}




- (void)setValues{
    
    NSDictionary *dic = _tripModel.user;
    
    [_ImageView1 sd_setImageWithURL:[NSURL URLWithString:dic[@"avatar_l"]] placeholderImage:[UIImage imageNamed:PLACE_HLODER]];
    
   
    
    
    
    
        
        _TitleView.text = dic[@"name"];
    _addLabel.text = _tripModel.timezone;
  
    
    
}

- (void)awakeFromNib {
    // Initialization code
//    if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"yeJianMoShi"] isEqualToString:@"isDay"]) {
//        self.backgroundColor = DAYCOLOR;
//    }else{
//        self.backgroundColor = NIGHTCOLOR;
//    }
//
//
//[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(changeColor:) name:@"yeJianMoShi" object:nil];
}

//- (void)changeColor:(NSNotification *)notification{
//    
//    if ([[[NSUserDefaults standardUserDefaults]objectForKey:@"yeJianMoShi"]isEqualToString:@"isNight"]) {
//        self.backgroundColor = NIGHTCOLOR;
//        _TitleView.textColor = [UIColor whiteColor];
//        _addLabel.textColor = [UIColor whiteColor];
//    }else{
//        
//        self.backgroundColor = DAYCOLOR;
//    }
//    
//}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)dealloc {
//    [[NSNotificationCenter defaultCenter] removeObserver:self name:@"changeColor" object:nil];
    [_ImageView1 release];
    [_TitleView release];
    [_addLabel release];
    [_logoLabel release];
    [super dealloc];
}
@end
